package rtc

import (
	"github.com/gofiber/fiber/v2"
	"github.com/gofiber/websocket/v2"
)

func InitRtcRoutes(r fiber.Router) {
	// 不能使用路径传参，fiber有bug！！！
	sseCtrl := NewRtcSseController()
	r.Get("/rtc/sse", sseCtrl.SseHandler)
	r.Get("/rtc/sse/send/:userid/:msg", sseCtrl.SendTestMsg)
	r.Get("/sse/ssetest", sseCtrl.Ssetest)

	wsCtrl := NewRtcWsController()
	r.Get("/rtc/ws", websocket.New(wsCtrl.WsHandler))
	r.Get("/rtc/ws/send/:userid/:msg", wsCtrl.SendTestMsg)
}
